<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 100px;
            height: 100px;
            background-color: #bfa;
            transform: 2s;
            margin: 100px auto;
            /* 变形的源点 
            默认值是center*/
            transform-origin: 0 0;
            transition: .3s;
        }

        .box1:hover {
            /* 
            对元素进行缩放的函数
            scaleX()  水平方向的缩放
            scaleY()   垂直方向缩放
            scale   双方向缩放
            */
            transform: scale(3);
        }

        .img-wrapper {
            width: 200px;
            height: 200px;
            border: 1px solid red;
            margin: 100px auto;
            overflow: hidden;
            transform-origin: 0 0;

        }
        img{
            transition: .3s;
        }

        .img-wrapper:hover img {
            
            transform: scale(2);
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="img-wrapper">
        <img width="200px" height="200px" src="./img/02.jpg" alt="">
    </div>
</body>

</html>